package com.xyzwps.xgments.bit;

public class CalculationDemo {

    static void log(Object target) {
        System.out.println(target);
    }

    @SuppressWarnings("all")
    public static void main(String[] args) {
        int a = 0b0000_1111;
        int b = 0b0011_1100;
        log("     a == 0000_1111");
        log("     b == 0011_1100");
        log(" a | b == 0011_1111 : " + ((a | b) == 0b0011_1111));
        log(" a & b == 0000_1100 : " + ((a & b) == 0b0000_1100));
        log(" a ^ b == 0011_0011 : " + ((a ^ b) == 0b0011_0011));
        log("a >> 3 == 0000_0001 : " + ((a >> 3) == 0b0000_0001));
        log("b >> 3 == 0000_0111 : " + ((b >> 3) == 0b0000_0111));
    }
}
